package com.yonyou.cyxdms.sysAuth.service.service.dealerchannel;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yonyou.cyx.framework.util.bean.ApplicationContextHelper;
import com.yonyou.cyx.function.exception.DALException;
import com.yonyou.cyxdms.framework.bean.dto.user_info.LoginInfoDto;
import com.yonyou.cyxdms.sysAuth.service.controller.dealerchannel.DealerSaleInfoController;
import com.yonyou.cyxdms.sysAuth.service.entity.TrDealerOrgRelationPO;
import com.yonyou.cyxdms.sysAuth.service.mapper.TrDealerOrgRelationMapper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.Collections;
import java.util.Map;

/**
 * Created by adu on 2019/10/10.
 */
@Service
public class AuthorizedInfoServiceImpl implements AuthorizedInfoService {
    private final Logger logger = LoggerFactory.getLogger(AuthorizedInfoServiceImpl.class);

    @Autowired
    TrDealerOrgRelationMapper trDealerOrgRelationMapper;

    @Override
    @Transactional(readOnly = true)
    public IPage<Map<String, Object>> queryAuthorizedById(Page page, Map<String, Object> queryCondition) {
        // 获取总条数
        page.setRecords(trDealerOrgRelationMapper.queryAuthorizedById(page, queryCondition));
        return page;
    }

    @Override
    public Integer addAuthorizedBrand(TrDealerOrgRelationPO trdealerorgrelationpo) {
        Integer billId = trdealerorgrelationpo.getBillId();

        return billId;
    }

    @Override
    public Integer deleteAuthorizedBrand(Integer orgRelationId) {
        return trDealerOrgRelationMapper.deleteAuthorizedBrand(orgRelationId);
    }
}
